package com.menggudf.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

public class ResultModel implements Serializable {
	/**
     * 
     */
	private static final long serialVersionUID = -2445273895966412540L;

	@JsonProperty("resultCode")
	Integer resultCode;

	String msg;

	private Object content;

	public ResultModel() {
	}

	public static ResultModel success() {
		return new ResultModel(ResultStatus.RESULT_STATUS_SUCCESS.getValue());
	}

	public ResultModel(Integer resultCode) {
		this.resultCode = resultCode;
	}

	public static ResultModel success(String msg, Object content) {
		return new ResultModel(ResultStatus.RESULT_STATUS_SUCCESS.getValue(),
				msg, content);
	}

	public static ResultModel fail() {
		return new ResultModel(ResultStatus.RESULT_STATUS_FAILURE.getValue());
	}

	public static ResultModel fail(String msg, Object content) {
		return new ResultModel(ResultStatus.RESULT_STATUS_FAILURE.getValue(),
				msg, content);
	}

	public ResultModel(Integer resultCode, String msg, Object content) {
		this.resultCode = resultCode;
		this.msg = msg;
		this.content = content;
	}

	public Integer getResultCode() {
		return resultCode;
	}

	public void setResultCode(Integer resultCode) {
		this.resultCode = resultCode;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getContent() {
		return content;
	}

	public void setContent(Object content) {
		this.content = content;
	}

}
